 const { csvModel } = require('../db/index')
 const Op = require('sequelize').Op
 const csv = require('csvtojson')

 
 async function queryAll(params) {
  const jsonArray= await csv().fromFile(__dirname + `/../uploads/${params.fileName}`);
  const rs = await csvModel.findAll()
  return rs
  for (let i = 0;i < 500;i++) {
    await csvModel.create({
      content: JSON.stringify(jsonArray[i])
    })
  }
  
  return {
    code: 200
  }
 }
 
 module.exports = {
   queryAll,
 }
 